﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SignalShopBase;

namespace TestModule
{
    public class RCFilterModule : SignalShopModule
    {
        public RCFilterModule() : base(NAME, PATH) {}

        public override void Execute(Signal target, Signal source)
        {
            double fres = 50;
            Complex c = new Complex();

            int N = target.N;

            for (int n = -N; n <= N; n++)
            {
                if (n != 0)
                {
                    c.Set(0, n).Inv().Mul(fres);
                    target[n].Set(c).Add(1, 0).Inv().Mul(c);
                }
                else target[n].Set(1, 0);
            }
        }

        private const string NAME = "RCFilter";
        private const string PATH = "Generate/RCFilter";
    }
}
